<extend name="Layout:list" />
<block name="title"><title>模型管理</title></block>
<block name="subnav">
    <a class="add fb" href="<?php echo U('Page/fieldadd') . '?template=' . $template; ?>"><em>添加字段</em></a>　<a class="on" href="<?php echo U('Page/fields') . '?template=' . $template; ?>"><em>字段管理</em></a>　|　<a href="<?php echo U('Page/index'); ?>"><em>页面管理</em></a>　|　<a href="<?php echo U('Page/template'); ?>"><em>模板设置</em></a>
</block>
<block name="main">
    <form name="myform" id="myform" action="__CONTROLLER__/listorder" method="post">
        <div class="table-list">
            <table width="100%" cellspacing="0">
                <thead>
                    <tr>
                        <th width="70">排序</th>
                        <th>字段名</th>
                        <th>别名</th>
                        <th width="100">类型</th>
                        <th width="50">必填</th>
                        <th width="150">管理操作</th>
                    </tr>
                </thead>
                <tbody class="td-line">
                    <?php foreach ($fields as $key => $field) { ?>
                    <tr>
                        <td align='center' width='70'><input name='listorders[<?php echo $field['fieldid']?>]' type='text' size='3' value='<?php echo $field['listorder']?>' class='input-text-c'></td>
                        <td align="center"><?php echo $field['field']?></td>
                        <td align="center"><?php echo $field['name']?></td>
                        <td width="100" align='center'><?php echo $field['formtype']?></td>
                        <td width="50" align='center'><?php echo $field['minlength'] ? '<font color="red">√</font>' : '<font color="blue">×</font>';?></td>
                        <td align='center'> <a href="__CONTROLLER__/fieldedit?template=<?php echo $template; ?>&fieldid=<?php echo $field['fieldid']?>">修改</a> |
                            <?php if(!in_array($field['field'],$forbid_fields)) { ?>
                            <a href="__CONTROLLER__/disabled?disabled=<?php echo $field['disabled'];?>&fieldid=<?php echo $field['fieldid']?>;"><?php echo $field['disabled'] ? '启用' : '禁用'; ?></a>
                            <?php } else { ?><font color="#BEBEBE"> 禁用 </font><?php } ?>|<?php if(!in_array($field['field'],$forbid_delete)) {?>
                            <a href="javascript:confirmurl('__CONTROLLER__/fielddelete?fieldid=<?php echo $field['fieldid']?>','确认要删除 『 <?php echo $field['name']; ?> 』 吗？')">删除</a><?php } else {?><font color="#BEBEBE"> 删除</font><?php }?>
                        </td>
                    </tr>
                    <?php } ?>
                </tbody>
            </table>
            <div class="btn"><input type="submit" class="button" name="dosubmit" value="排序" /></div>
        </div>
    </form>
</block>